﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="CustomActionFileType"
xmlns="http://schemas.microsoft.com/pag/gax-core"
Bound="false">
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>Custom Action for File Extension</Caption>
  <Description>Adds a custom action for a specific extension (e.g. .docx)</Description>
  <HostData Priority="20">
    <Icon File="Help/Icons/icon_CustomActions.ico" />
    <CommandBar Menu="SPSFProjectCustomActions"/>
    <CommandBar Menu="SPSFFolderCustomActions"/>
    <spsf:MetaData
      Visible="true"
      BindingType="ElementManifestReference"
      BindingTypeTemplate="ElementManifestReferenceTemplate"
      TestType="BaseSiteFeatureRecipeRunner"
      Enabled="true"
      CreateVSTemplate="true"
      FeatureScopes="Web;Site;WebApplication;Farm"
      Category="CustomActions" xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[]]>
      </spsf:WebPageContent>
      <spsf:Test>
        <spsf:TestCases>
          <spsf:TestCase Name="CustomActionFileTypeWithUrlAction" Type="SolutionTestCase">
            <spsf:TestCaseArguments>
              <spsf:TestCaseArgument Name="CustomActionName">FileTypeActionUrlAction</spsf:TestCaseArgument>
              <spsf:TestCaseArgument Name="CustomActionType">UrlActionTag</spsf:TestCaseArgument>
            </spsf:TestCaseArguments>
          </spsf:TestCase>
          <spsf:TestCase Name="CustomActionFileTypeWithControlClass" Type="SolutionTestCase">
            <spsf:TestCaseArguments>
              <spsf:TestCaseArgument Name="CustomActionName">FileTypeActionControlClass</spsf:TestCaseArgument>
              <spsf:TestCaseArgument Name="CustomActionType">ClassFile</spsf:TestCaseArgument>
            </spsf:TestCaseArguments>
          </spsf:TestCase>
          <spsf:TestCase Name="CustomActionFileTypeWithControlTemplate">
            <spsf:TestCaseArguments>
              <spsf:TestCaseArgument Name="CustomActionName">FileTypeActionControlTemplate</spsf:TestCaseArgument>
              <spsf:TestCaseArgument Name="CustomActionType">WebControl</spsf:TestCaseArgument>
            </spsf:TestCaseArguments>
          </spsf:TestCase>
        </spsf:TestCases>
      </spsf:Test>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <xi:include href="../../BaseArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <xi:include href="../BaseFeatureArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <xi:include href="BaseCustomActionArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Argument Name="CustomActionRegistrationId" Type="System.String" Required="true" >
      <ValueProvider Type="Evaluator" Expression="docx" />
    </Argument>
    <Argument Name="CustomActionRegistrationType" Required="true" >
      <ValueProvider Type="Evaluator" Expression="FileType" />
    </Argument>
    <Argument Name="CustomActionLocation" Type="NameValueItem" Required="true" >
      <ValueProvider Type="DefaultNameValueItemProvider" Name="EditControlBlock" Value="EditControlBlock" />
    </Argument>

    <Argument Name="CustomActionAddIcon" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator" Expression="true" />
    </Argument>
    <Argument Name="CustomActionIconSize">
      <ValueProvider Type="Evaluator" Expression="16" />
    </Argument>

    <Argument Name="CustomActionUrlActionParameters" Type="System.String" Required="false" >
      <ValueProvider Type="Evaluator" Expression="?ItemUrl={ItemUrl}&amp;ListId={ListId}" />
    </Argument>

    <Argument Name="CustomActionElementsTemplate" Type="System.String" Required="false" >
      <ValueProvider Type="Evaluator" Expression="Text\CustomActions\elements.xml.t4" />
    </Argument>

  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="SPALM.SharePointSoftwareFactory.Library.CustomWizardPages.FeatureSelectionPage, SPALM.SharePointSoftwareFactory.Library" />
        <Page Height="350">
          <Title>File Extension</Title>
          <Fields>
            <Field ValueName="CustomActionRegistrationId" Label="Extension" >
              <Help>Enter the file extension.</Help>
            </Field>
          </Fields>
        </Page>
        <!-- include general custom action pages -->
        <xi:include href="BaseCustomActionPages.include"  parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-wizards) xpointer(/p:Pages/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />
        <xi:include href="BaseCustomActionPagesRegistration.include"  parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-wizards) xpointer(/p:Pages/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />
        <xi:include href="BaseCustomActionPagesUrlSettings.include"  parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-wizards) xpointer(/p:Pages/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />
      </Pages>
    </Wizard>
  </GatheringServiceData>

  <!-- include general actions -->
  <xi:include href="BaseCustomActionActions.include" xmlns:xi="http://www.w3.org/2001/XInclude" />

</Recipe>